/**
 * 加载界面
 */
class loadingScene extends Frame.Game.Scene {
    init() {
        //注册控制器
        Frame.MVC.registController(ModuleKey.loading, new loadingController(), new loadingView());
        //加载资源
        Frame.RES.loadGroup("preload", this.resComplete, this.resProgress, this);
    }
    open() {
        //添加该场景需要的显示层
        this.openLayer(Frame.Display.Layer.gameContent);
        //开启view
        this.openView(ModuleKey.loading, Frame.Display.Layer.gameContent, 1, 2, 3, 4);
    }
    private resComplete() {
        Frame.Game.registScene(SceneKey.main, new mainScene());
        Frame.Game.registScene(SceneKey.game, new gameScene());
        Frame.Game.runScene(SceneKey.main);
    }
    private resProgress($loaded, $total) {
        (<loadingController>Frame.MVC.getController(ModuleKey.loading)).showProgress($loaded, $total);
    }
}